<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        html {
            /* 定义CSS变量-如果是在html中定义的的即全局可以使用 */
            --main-color: red
        }

        .container1 {
            /* 定义CSS变量-如果是在container1中定义的的即container1内部可以使用 */
            --con-color: red
        }

        .box1,
        .box2 {
            /* 使用定义的CSS变量 */
            background-color: var(--con-color);
        }

        .box3 {
            /* 使用定义的CSS变量 */
            color: var(--main-color);
        }

        * {
            margin: 0;
            padding: 0;
        }

        .A {
            display: flex;
            justify-content: space-between;
        }

        .container1,
        .container2 {
            margin: 20px 0 20px 20px;
            width: 50%;
            padding: 0 20px 20px 20px;
            border: 1px solid #3f3f3f;
            box-shadow: 1px 1px 5px #000;
        }

        .container2 {
            margin-right: 20px;
        }

        .box1,
        .box2,
        .box3 {
            width: 100%;
            line-height: 200px;
            margin-top: 20px;
            text-align: center;
            font-size: 20px;
            font-weight: bold;
            text-shadow: 0 0 5px #efefef;
            border: 1px solid #000;
            box-shadow: 0 0 5px #000;
        }
    </style>
</head>

<body>
    <div class="A">
        <div class="container1">
            <div class="box1">box1</div>
            <div class="box2">box2</div>
            <div class="box3">box3</div>
        </div>
        <div class="container2">
            <div class="box1">box1</div>
            <div class="box2">box2</div>
            <div class="box3">box3</div>
        </div>
    </div>
</body>

</html>